<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductImageResource extends JsonResource
{
    public function toArray($request)
    {
    	$data = $this->resource;
    	
        return [
	        'id' => (int)$data->id,
	        'product_id' => (int)$data->product_id,
	        'image_url' => img_product_path($data->image),
	        'brief' => $data->brief ?? '',
	        'created_at' => (string)$data->created_at,
        ];
    }
}
